﻿using Enyim.Caching;
using Ayatta.Contract;
using System.Web.Mvc;
using Ayatta.Contract.Domain;
using Web.Base.Extensions;
using Web.Manage.Controllers;
using Web.Manage.Areas.Auction.Models;

namespace Web.Manage.Areas.Auction.Controllers
{
    public class HomeController : AdminBaseController
    {
        public HomeController(ILogService logService, IBaseService baseService, IExtraService extraService, IStoreService storeService, IOrderService orderService, IGameService gameService, IAuctionService auctionService, IPassportService passportService, IPaymentService paymentService, IMemcachedClient memcachedClient)
            : base(logService, baseService, extraService, storeService, orderService, gameService, auctionService, passportService, paymentService, memcachedClient)
        {
        }

        public ActionResult Index(int page = 1, int size = 2, string name = null, AuctionGrade? grade = null, AuctionStatus? status = null)
        {
            var model = new HomeControllerModel.Index();
            model.Name = name;
            model.Status = status;
            model.Grade = grade;
            model.Status = status;
            model.Auctions = AuctionService.GetPagedAuctions(page, size, name, grade, status).ToPagedList(page, size);
            return PartialView(model);
        }

    }
}
